﻿<%@ Control Language="C#" AutoEventWireup="true"
 CodeBehind="ComparativoAddItemSelecGrid.ascx.cs" 
 Inherits="UILGestion.Control.ComparativoAddItemSelecGrid" %>
<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc1" %>

 <script type="text/javascript">
     function SelectAll(frm, id) {

         var frm = document.getElementById("itemPlaceHolderContainer");
         for (i = 1; i < frm.rows.length; i++) {
             var checkbox = frm.rows[i].cells[0].childNodes[1];
             if (checkbox != null)
                 checkbox.checked = document.getElementById(id).checked;
         }
     };
    </script>


    <asp:DataPager ID="pager" PagedControlID="ListView1" runat="server">
    <Fields>
      <cc1:PagerField NextPageImageUrl="~/Images/arrow_right2.gif" PreviousPageImageUrl="~/images/arrow_left.gif" />
    </Fields>
</asp:DataPager>
<asp:ListView ID="ListView1" runat="server" 
        OnDataBound="ListView1_DataBound"  ClientIDMode="Static" class="yui-grid"
            DataKeyNames="idInternal" onitemdatabound="ListView1_ItemDataBound">
    <LayoutTemplate>
        <table id="itemPlaceHolderContainer" border="0" runat="server">
            <tr id="Tr1" runat="server">
             <th><asp:CheckBox runat="server" ID="chkSelectAll" ClientIDMode="Static" onclick="SelectAll('ListView1','chkSelectAll')" />
            </th>
                <th id="Th1" runat="server">
                    <asp:LinkButton ID="lb2" CommandName="Sort"
                    CommandArgument="codigo" runat="server">codigo</asp:LinkButton>
                </th>
                <th id="Th3" runat="server">
                    <asp:LinkButton ID="lb3" CommandName="Sort" 
                    CommandArgument="descripcion" runat="server">Descripcion</asp:LinkButton>
                </th>
                <th id="Th5" runat="server">
                    <asp:LinkButton ID="LinkButton3" CommandName="Sort" 
                    CommandArgument="unidad" runat="server">unidad</asp:LinkButton>
                </th>
                <th id="Th2" runat="server">
                    <asp:LinkButton ID="LinkButton1" CommandName="Sort"
                     CommandArgument="Total" runat="server">Total</asp:LinkButton>
                </th>
             
                
            </tr>
            <tr id="itemPlaceholder" runat="server">
            </tr>
        </table>



    </LayoutTemplate>
    <ItemTemplate>
        <tr style='background-color: <%# (Container.DataItemIndex % 2 == 0)?"#eee":"#fff" %>'>
            <td>
         
             <asp:CheckBox runat="server" ID="chkEmployeeSelector"  />
         
                
            </td>
            <td >
                    <%# Eval("codigo")%> <br />
            </td>
            
            <td >
                    <%# Eval("descripcion")%> <br />
            </td>
            <td >
                    <%# Eval("unidad")%> <br />
            </td>
             <td align="right">
                  <table>
                <tr>
                <td align="right">Cantidad:</td>
                <td align="right"><asp:Label ID="cantidadDisplbl" runat="server" 
                    Text='<%# Eval("cantidadDisp")%>'></asp:Label></td>
                </tr>
                <tr>
                <td align="right">Precio:</td>
                <td align="right"><asp:Label ID="precioLabel" runat="server" 
                    Text='<%# Eval("precioMon")%>'></asp:Label></td>
                </tr>
                <tr>
                <td align="right">Disponible:</td>
                <td align="right"><asp:Label ID="totalDispMon" runat="server" 
                    Text='<%# Eval("totalDispMon")%>'></asp:Label></td>
                </tr>
                </table>
            </td>
            
        
        </tr>
    </ItemTemplate>
    <EmptyDataTemplate>
        <table id="Table1" runat="server" style="">
            <tr>
                <td>
                    <h2 style="color: Red ; font-size:small">
                  
                        No existe Informacion.</h2>
                </td>
            </tr>
        </table>
    </EmptyDataTemplate>
</asp:ListView>





    
     



    
     